package com.example.demo.thread;

import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;

import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Demo101 {


    private final static List<String> domains;

    static {
        domains = Arrays.asList("VIRIDE",
                "xingyuan",
                "2019xinyu",
                "taisheng2008",
                "pridechem",
                "jiapansj",
                "ket-dq",
                "zhichengpla",
                "bjfyhhb",
                "sujiaowang",
                "wjmf8",
                "xmywq126",
                "sj19801014",
                "xinxinghuagong",
                "lihongsj",
                "bjydbfm",
                "pingchuan888",
                "mxjysj",
                "account",
                "zhuoxin508",
                "songpan",
                "wanji168",
                "aorunjia112",
                "mouldxx",
                "hys724",
                "tfemc",
                "jessicachem",
                "shpuhao",
                "rongtaisujiao",
                "nuoda",
                "xyfxhbbwjc",
                "chenyouling",
                "qlh811",
                "yaoxunju",
                "13161641488",
                "maikos",
                "fihonor",
                "jaynn",
                "jcsujiao",
                "jitianxinye",
                "3600",
                "jxhg668",
                "jiansheng88",
                "wznykj",
                "bohaodz",
                "xingran666",
                "yysujiao",
                "13879788671",
                "pc888",
                "pingzhi1002",
                "lingyun104211",
                "tshmp",
                "wenfengsuji",
                "a19887021",
                "ydshuji",
                "zwj20050810",
                "POM-500P",
                "xjj710826",
                "qiantaizwei",
                "yilisj",
                "15888159906",
                "xiaomeng18qi",
                "htyiqi",
                "sinopec1358",
                "ycsj1202",
                "youmengtanhei",
                "sujiaook",
                "chihuangsh",
                "hsqxzh",
                "hongdasjcc8",
                "jinggu",
                "shshfdj",
                "hmtbz",
                "tyy8898",
                "kangpas",
                "gdparker",
                "wangtianyang123",
                "jusxj",
                "honey235729",
                "syddfjd",
                "crsta",
                "taianluming",
                "gxglhc",
                "zhou555",
                "cxrtrq",
                "a1766264639",
                "apkj02",
                "hz99santai",
                "alading",
                "yongjiumuju88",
                "zzzkzjj",
                "tiananjing",
                "baoxingnuo",
                "saiyangsujiao",
                "cqcsj5",
                "hztedq",
                "liguoxuan",
                "aicheng8805j",
                "lbwyj321456987",
                "hnglpjj",
                "tinger",
                "dghwsujiao",
                "njxkhb",
                "st666",
                "wanrunhuagong",
                "13600261810",
                "asd3333",
                "liangrunguomao",
                "zkxjzp",
                "changshi88",
                "juren5350",
                "zsjx8",
                "rongquan456",
                "dgshenyu",
                "zhengmai",
                "xry5288",
                "mingxu456",
                "ycjt168",
                "jiahuihz",
                "pengchengmuban",
                "5036262",
                "fscsbz62",
                "hsguoheng",
                "renqiv",
                "loobo6",
                "shmysmjs",
                "lvmenglvye",
                "bdm1014",
                "gzzhichun",
                "qztsxpj",
                "nbwysh1",
                "hbcrxs",
                "tanxin168",
                "hbdecai",
                "hongsusuhua",
                "jzslw",
                "lzj1208",
                "jiaaocn1",
                "yuhua",
                "dzwqxj",
                "grxjzp",
                "hatching",
                "moteng",
                "mwjlsj888",
                "czjcganzaoji888",
                "czrxgzj",
                "jsqskj888",
                "yuzel888",
                "hcwsshop1411225888",
                "hcws0000889304888",
                "15322837592",
                "tjztyjx888",
                "gnskjc888",
                "sdzrskjc888",
                "gsskjc888",
                "jsy2308882488888",
                "18151524259",
                "cxfcxf8888",
                "jxbyxs888",
                "acemien8805t888",
                "sankev888",
                "preflyboiler888",
                "yd815057392929888",
                "hcwsfsxkl888",
                "xiangjietester888",
                "18038731099",
                "gzqjcy",
                "jnsyjx88888",
                "hfhdpe888",
                "zczhongtian888",
                "tadntgcl888",
                "huang5988558888",
                "defsd661888",
                "zgcut888",
                "wantai9000888",
                "zjhaibeikeji888",
                "dzxesk888",
                "baojisensor888",
                "lsdsjby888",
                "only999888",
                "mantebw",
                "pipi1977888",
                "cwgeqiangban888",
                "qingteng888",
                "xinjuncheng",
                "baozhuangji371888",
                "kyck168888",
                "suyuhg",
                "weike66888",
                "wudepro888",
                "yinamanda888",
                "sr2015888",
                "lwd888",
                "wutengjidian10888",
                "glksjx888",
                "hengmei1718888",
                "thxl",
                "qinxingjsj",
                "mingjiedq",
                "18669612906dyn");
    }

    private static ExecutorService executorService;

    private static int a = 0;

    private static final Object lock = new Object();


    public static void main(String[] args) {
        executorService = Executors.newFixedThreadPool(50);
        for (int i = 0; i < 200; i++) {
            ss(i);
        }
    }

    private static void ss(int i) {
        executorService.execute(() -> HttpUtil.createGet("https://www.51pla.com/product/search?q=原料" + domains.get(i)).execute());
    }
}
